<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>添加库存申请单</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<link rel="stylesheet" href="/static/layui/css/layui.css" />
<link rel="stylesheet" href="/static/ui/css/ui.css" />
	</head>
	<body>
		<div class="layui-form" action="">
			<div class="mainBox">
				<div class="main-container">
					<div class="main-container">
						    <div class="layui-card">
						      <div class="layui-card-header">申请详情</div>
						      <div class="layui-card-body" id="view">
						      </div>
						    </div>
						

					</div>
				</div>
			</div>
			
		</div>
        <script id="tpl" type="text/html">
            {{#  layui.each(d, function(index, item){ }}
              <li>
                <span>{{ item.label }}：</span>
                <span>{{ item.val || '' }}</span>
              </li>
            {{#  }); }}
            {{#  if(d.length === 0){ }}
              无数据
            {{#  } }} 
            </ul>
          </script>
		<script src="../config.js"></script>
		<script src="/static/layui/layui.js"></script>
		<script src="/static/ui/ui.js"></script>
		<script>
			layui.use(['form', 'layer', 'laytpl'], function() {
				let form = layui.form,
					layer = layui.layer,
                    laytpl = layui.laytpl,
					$ = layui.$,
					req = _req();
				_get(layui, 'form/editDataBefore?id=' + req.id, res => {
                        let data = JSON.parse(res.data.data)
                        //console.log(data)
                        let lebel = res.formData.formdesign;
                        lebel.forEach(d => {
                            d.val = data[d.name]
                            //d.val = lebel.find(e => e.name == d. )
                        })
                        console.log(lebel)
                        laytpl($('#tpl').html()).render(lebel, function(html){
                            $('#view').html(html)
                        });

				});


			});
		</script>

	</body>
</html>
